@include('user.usertop')
<link rel="stylesheet" href="{{URL::asset('/ucenter/css/base.css')}}">
<link rel="stylesheet" href="{{URL::asset('/user/css/analystCenter.css')}}">
<link rel="stylesheet" href="{{URL::asset('/user/css/cash.css')}}">
<!-- 默认体现部分border-bottom -->
<script>
    $('.sub-personCenter li').attr('class','');
    $('.sub-personCenter li:eq(3)').attr('class','active');
</script>
<div style="clear: both;"></div>
<!-- 提现主体部分 -->

<div class="l_tixian clearfix">
    <div class="l_title clearfix">
        <ul>
            <li class="current"><a href="javascript:;">申请提现</a></li>
            <li><a href="javascript:;">添加银行卡</a></li>
        </ul>
    </div>
    <div class="l_cont clearfix">
        <!-- 申请提现 -->
        <div>
            <!-- 奖励展示 -->
            <div class="l_profile">
                <ul>
                    <li>
                        <div class="img">
                            <img src="{{URL::asset('/images/gaoshouyi.png')}}" alt="" style="margin-top: -15px;">
                        </div>
                        <div class="l_txt">
                            <span>{{($weekcountbonus+$handanbonus)?($weekcountbonus+$handanbonus):0}}</span>
                            <span>总奖励</span>
                        </div>
                    </li>
                    <li class="l_line"></li>
                    <li>
                        <div class="img">
                            <img src="{{URL::asset('/images/ketixian.png')}}" alt="">
                        </div>
                        <div class="l_txt">
                            <span>{{($weekcountbonus+$handanbonus-$drawmoney)?($weekcountbonus+$handanbonus-$drawmoney):0}}</span>
                            <span>可提现</span>
                        </div>
                    </li>
                    <li class="l_line"></li>
                    <li>
                        <div class="img">
                            <img src="{{URL::asset('/images/lishi.png')}}" alt="" style="margin-top: -4px;">
                        </div>
                        <div class="l_txt">
                            <span>{{$drawmoney?$drawmoney:0}}</span>
                            <span>历史提现</span>
                        </div>
                    </li>
                </ul>
            </div>
            <!-- 选择银行卡 -->
            <div class="l_cbank">
                <div class="bank_tit">
                    <span>选择银行卡</span>
                </div>
                <div class="bank_con clearfix">
                    <span>选择银行</span>
                    <div>
                        <div class="bank_box">
                            @if($banklist)
                                @foreach($banklist as $bkey=>$bval)
                                    <span class="bank_name" id="bank_name" bank_id="{{$bval->id}}">{{$bval->bank}}</span>
                                    <span class="card_num" id="card_num">{{substr_replace($bval->bank_number,'*********','6','-4')}}</span>
                                    <span class="change" onclick="change()">更换</span>
                                    @break
                                @endforeach
                            @else
                                <span style="padding-left:30px;">请点击下方按钮添加您的银行卡</span>
                            @endif
                        </div>
                        @if($banklist)
                            <ul class="changecon" style="display: none;">
                                @foreach($banklist as $bakey=>$baval)
                                    <li class="bank_box b_box">
                                        <i @if($bakey==0) class="current" @endif><input type="hidden" value="{{$baval->id}}" class="bankid"></i>
                                        <span class="bank_name">{{$baval->bank}}</span>
                                        <span class="card_num">{{substr_replace($baval->bank_number,'*********','6','-4')}}</span>
                                        <span class="change" style="color:#b1b1bd;" onclick="delbank({{$baval->id}},this,{{$bakey}})">删除银行卡</span>
                                    </li>
                                @endforeach
                            </ul>
                        @endif
                    </div>
                </div>
                <a href="javascript:;" style="margin-left: 192px;color:#3b9ce0;font-size:16px; @if(!$banklist || count($banklist)<3)display: block;@else display: none; @endif" class="gotoBank" >添加银行卡</a>
            </div>
            <!-- 周赛奖励 -->
            <div class="l_rank">
                @if($weekprofit)
                    <div class="rank_tit">
                        <span>周赛奖励</span>
                    </div>
                    @foreach($weekprofit as $wkey=>$wval)
                        <div class="rank_btn">
                            <span>{{$wkey}}总奖励：<span style="color:#fe434c;font-size: 16px;margin-right:24px;">¥{{$wval['monthtotal']}}</span></span>
                        </div>
                        <div class="rank_con">
                            <div class="con_title">
                                <div style="margin-left:34px;">{{$wkey}}奖励</div>
                                <div class="shouqi">
                                    收起
                                    <a href="javascript:;">
                                        <img src="{{url('images/shou.png')}}" alt="">
                                    </a>
                                </div>
                            </div>
                            @if($wval['monthdata'])
                                <ul class="shoucon">
                                    @foreach($wval['monthdata'] as $wkkey=>$wvval)
                                        <li class="clearfix">
                                            <div class="rank_time" style="margin-left: 64px;">
                                                <span>{{date('Y-m-d',strtotime(date('Y-m-d',$wvval->week_time)."-".(date('w',strtotime(date('Y-m-d',$wvval->week_time))) ? date('w',strtotime(date('Y-m-d',$wvval->week_time))) - 1 : 6).' days'))}}</span>
                                                <span>到</span>
                                                <span>{{date('Y-m-d',strtotime( date('Y-m-d',strtotime(date('Y-m-d',$wvval->week_time)."-".(date('w',strtotime(date('Y-m-d',$wvval->week_time))) ? date('w',strtotime(date('Y-m-d',$wvval->week_time))) - 1 : 6).' days'))."+6 days"))}}</span>
                                            </div>
                                            <div class="rank_paiming">
                                                <span>周赛排名</span>
                                                <span>第<span style="color:#fe434c;font-size: 12px;">{{$wvval->ranking}}</span>名</span>
                                            </div>
                                            <div class="rank_jiangjin">
                                                <span>奖金</span>
                                                <span>¥{{$wvval->actual_bonus}}</span>
                                            </div>
                                            @if($wvval->draw_status == 1)
                                                <button class="rank_ling" onclick="weekdraw({{$wvval->id}},this)">领取</button>
                                            @elseif($wvval->draw_status == 2)
                                                <button class="rank_ling" style="background: grey;">领取中</button>
                                            @else
                                                <button class="rank_ling" style="background: grey;">已领取</button>
                                            @endif
                                        </li>
                                    @endforeach
                                </ul>
                            @endif
                        </div>
                    @endforeach
                @endif
            </div>

            <!-- 策略奖励 -->
            <div class="l_rank l_hdrank">
                @if($handanprofit)
                    <div class="rank_tit">
                        <span>策略奖励</span>
                    </div>
                    @foreach($handanprofit as $hkey=>$hval)
                        <div class="rank_btn">
                            <span>{{$hkey}}总奖励：<span style="color:#fe434c;font-size: 16px;">¥{{$hval['monthtotal']}}</span></span>
                            @if($hval['monthstatus'] == 0)
                                <button class="rank_ling" onclick="orderdraw('{{$hkey}}',{{$hval['monthtotal']}},this)">领取</button>
                            @elseif($hval['monthstatus'] == 1)
                                <button class="rank_ling" style="background-color: grey">领取中</button>
                            @elseif($hval['monthstatus'] == 2)
                                <button class="rank_ling" style="background-color: grey">已领取</button>
                            @else
                                <button class="rank_ling" style="background-color: grey">拒绝领取</button>
                            @endif
                        </div>
                        <div class="rank_con handan_con">
                            <div class="con_title">
                                <div style="margin-left:34px;">{{$hkey}}奖励</div>

                                <div class="shouqi">
                                    收起
                                    <a href="javascript:;">
                                        <img src="{{url('images/shou.png')}}" alt="">
                                    </a>
                                </div>
                            </div>
                            @if($hval['monthdata'])
                                <ul class="shoucon">
                                    @foreach($hval['monthdata'] as $hhkey=>$hhval)
                                        <li class="clearfix">
                                            <div class="rank_time" style="margin-left: 64px;">
                                                <span>{{date('Y-m-d H:i:s',$hhval->end_time)}}</span>
                                            </div>
                                            <div class="rank_paiming">
                                                <span>入场价</span>
                                                <span>{{$hhval->begin_point}}</span>
                                            </div>
                                            <div class="rank_jiangjin">
                                                <span>平仓价格</span>
                                                <span>{{$hhval->end_point}}</span>
                                            </div>
                                            <div class="rank_jiangjin">
                                                <span>止盈</span>
                                                <span>{{$hhval->profit_point}}</span>
                                            </div>
                                            <div class="rank_jiangjin">
                                                <span>止损</span>
                                                <span>{{$hhval->loss_point}}</span>
                                            </div>
                                            <div class="rank_jiangjin">
                                                <span>最终盈亏</span>
                                                <span>{{$hhval->final_point}}</span><span>点</span>
                                            </div>
                                            <div class="rank_jiangjin">
                                                <span>奖励：</span>
                                                <span style="color:#fe434c;font-size: 12px;">¥{{$hhval->money}}</span>
                                            </div>
                                        </li>
                                    @endforeach
                                </ul>
                            @endif
                        </div>
                    @endforeach
                @endif
            </div>
            <!-- 客户订阅奖励 -->
            <div class="l_rank kehu">
                <div class="rank_tit">
                    <span>订阅奖励</span>
                    <div class="rank_btn kehu_btn">
                        <span>5月份总奖励：<span style="color:#fe434c;font-size: 16px;">¥0</span></span>
                        <button class="rank_ling" style="background-color: grey">领取</button>
                    </div>
                </div>
                <div class="rank_con gendan_con">
                    <div class="con_title">
                        <div style="margin-left:34px;">2017年5月奖励</div>

                        <div class="shouqi">
                            收起
                            <a href="javascript:;">
                                <img src="{{url('images/shou.png')}}" alt="">
                            </a>
                        </div>
                    </div>
                    {{--<ul class="shoucon">
                          <li class="clearfix">
                                <div class="rank_time" style="margin-left: 64px;">
                                      <span>2016-04-13 12:12:12</span>
                                </div>
                                <div class="rank_paiming second">
                                      <span>订阅人数</span>
                                      <span>8</span>
                                </div>
                                <div class="rank_jiangjin third">
                                      <span>奖励：</span>
                                      <span style="color:#fe434c;font-size: 12px;">¥50</span>
                                </div>
                          </li>
                           <li class="clearfix">
                                <div class="rank_time" style="margin-left: 64px;">
                                      <span>2016-04-13 12:12:12</span>
                                </div>
                                <div class="rank_paiming second">
                                      <span>订阅人数</span>
                                      <span>8</span>
                                </div>
                                <div class="rank_jiangjin third">
                                      <span>奖励：</span>
                                      <span style="color:#fe434c;font-size: 12px;">¥50</span>
                                </div>
                          </li>
                           <li class="clearfix">
                                <div class="rank_time" style="margin-left: 64px;">
                                      <span>2016-04-13 12:12:12</span>
                                </div>
                                <div class="rank_paiming second">
                                      <span>订阅人数</span>
                                      <span>8</span>
                                </div>
                                <div class="rank_jiangjin third">
                                      <span>奖励：</span>
                                      <span style="color:#fe434c;font-size: 12px;">¥50</span>
                                </div>
                          </li>
                           <li class="clearfix">
                                <div class="rank_time" style="margin-left: 64px;">
                                      <span>2016-04-13 12:12:12</span>
                                </div>
                                <div class="rank_paiming second">
                                      <span>订阅人数</span>
                                      <span>8</span>
                                </div>
                                <div class="rank_jiangjin third">
                                      <span>奖励：</span>
                                      <span style="color:#fe434c;font-size: 12px;">¥50</span>
                                </div>
                          </li>
                    </ul>--}}
                </div>
            </div>
        </div>
        <!-- 添加银行卡 -->
        <div style="display:none">
            <div class="l_top">
                <div class="top">
                    <div><span class="bankinfo">银行卡信息</span><span class="tip">(请您输入真实有效的信息)</span></div>
                    <div class="l_bank_info">
                        <form action="" method="post">
                            <div class="l_name">
                                <span>姓名</span><span style="margin-left: 20px;">@if($moreinfo)*{{mb_substr($moreinfo->username,1,(mb_strlen($moreinfo->username,'utf-8')-1),'utf-8')}}@endif</span>
                            </div>
                            <div class="l_idcard">
                                <span>身份证号</span><span style="margin-left: 20px;">@if($moreinfo){{substr_replace($moreinfo->idcard,'********','6','-4')}}@endif</span>
                            </div>
                            <div>
                                <span>银行卡号</span> <input type="text" id="banknum" name="cardbank" placeholder="请输入银行卡号">
                            </div>
                            <div style="height:40px; margin-left: 78px;color: #91919d;font-size:12px;">
                                请输入农业、工商、建设、交通、中国银行卡号
                            </div>
                            <div>
                                <div class="l_fl l_kaihu">开户行</div>
                                <div data-toggle="distpicker" class="l_fl l_select">
                                    <select id="province"  data-province="—— 省 ——" class="l_sel"></select>
                                    <select id="city" data-city="—— 市 ——" class="l_sel l_seltwo"></select>
                                </div>
                                <div class="l_bank_name l_select">
                                    <select name="" id="bank_hang" class="l_sel">
                                        <option value="选择银行">--选择银行--</option>
                                        <option value="中国农业银行">中国农业银行</option>
                                        <option value="中国工商银行">中国工商银行</option>
                                        <option value="中国建设银行">中国建设银行</option>
                                        <option value="中国交通银行">中国交通银行</option>
                                        <option value="中国中国银行">中国中国银行</option>
                                    </select>
                                    <input type="text" placeholder="请输入开户行" class="l_sel" name="zhihang" id="zhihang">
                                    <span style="margin-left: 12px;">支行</span>
                                </div>
                            </div>
                        </form>
                    </div>
                </div>
                <!-- 上传银行卡 -->
                <div class="l_bankCard">
                    <div class="l_upLoad clearfix">
                        <span style="line-height: 110px;margin-right: 18px;">上传照片</span>
                        <!-- 银行卡照片 -->
                        <div class="file_upload" id="frontBox">
                            <input style="display: none;" name="bankimg" id="bankimg" type="text"/>
                            <img src="{{URL::asset('/images/rectbank.png')}}" alt="" id='bank_img'>
                            <form id="uploadForm" name="uploadForm" action="{{url('uploadimg')}}" method="post">
                                <input style="display: none;" name="image" type="file" class="bankfile" id="bankfile">
                                <input style="display: none;" name="type" type="text" value="3"/>
                            </form>
                        </div>
                    </div>
                    <button onclick="uploadBank(this);" style="margin-left: 74px;">提交</button>
                </div>
            </div>
        </div>
    </div>
</div>

<!-- 上传银行卡成功提示 -->
<div class="l_bank_success">
    <div class="scc_pic">
        <img src="{{URL::asset('/images/success.png')}}" alt="">
    </div>
    <div class="scc_txt"><span>提交成功</span></div>
</div>

<!-- 领取成功提示 -->
<div id="l_maskDiv">
  策略奖励满一月可提现
</div>
<div style="clear: both;"></div>

<script src="{{URL::asset('public_js/distpicker.data.js')}}"></script>
<script src="{{URL::asset('public_js/distpicker.js')}}"></script>
<script src="{{URL::asset('user/js/cash.js')}}"></script>

<style>
    #footer{
        margin-top: 100px;
    }
</style>
<script>
    var imgurl     = "{{url('uploadimg')}}";//上传图片地址
    var dobank     = "{{url('dobank')}}";//添加银行卡
    var ziliaotype = '{{$ziliaotype}}';// 为1时 需要去完善资料
    var gowanshan  = "{{url('/authenticate?id=cardauth')}}";
    var gotologin  = "{{ url('/login') }}";
    var dodelbank  = '{{url("/delbank")}}';//删除银行卡
    var doweekdraw = '{{url("/weekdraw")}}';//周赛领取
    var dohandandraw = '{{url("/handandraw")}}';//策略领取
    var doselectbank = '{{url("/doselectbank")}}';//设置默认选中银行卡
</script>
@include('layout.footer')
